package next.Functionality;

import android.content.Intent;
import android.util.Log;
import android.widget.VideoView;
import next.SupportFunctionality.Music;

public class AudioVideoFunctionality extends NetworkingFunctionality {

	//--Variables--
	protected VideoView videoView;
	
	/**Called when is necessary to start video */
	public void OpenVideo(String URL) {
		
		//--Default Values 
		if (URL!=null){
		Intent i = new Intent("next.SupportFunctionality.VideoMediaPlayer");
		b.putString("URL", URL);
		i.putExtras(b);
		startActivity(i);
		}
		else 
		{
			Log.d("Error opening video", "URL is null");
		}
		
	}

	/**Called when is necessary to start a sound */
	public void OpenAudio(Integer pista) {
		Music.play(this, pista);
	}
	
	/**Called when is necessary to stop a sound */
	public void CloseAudio() {
		Music.stop(this);
	}

	
	/**Sound is releasing resources */
	@Override
	public void onDestroy() {
		Music.stop(this);
		super.onDestroy();
	}

}
